home *** CD-ROM | disk | FTP | other *** search
- /*
- * critic.c - initialization (and data definition) for the talking bore.
- * This program was created with Aztec C Developers' version 1.06I
- */
-
- #include <quickdraw.h>
- #include <font.h>
- #include <window.h>
- #include <osutil.h>
- #include <menu.h>
- #include <event.h>
- #include <textedit.h>
- #include <dialog.h>
- #include <desk.h>
- #include <control.h>
- #include <toolutil.h>
- #include <resource.h>
- #include <packages.h>
-
- #define DATA
- #include "critic.h"
- #undef DATA
-
- #define maxStackSize 8192 /* max size of stack; the heap gets the rest */
-
- /*
- * main() - start the program.
- */
-
- main()
- {
- /*
- * Initialize the Toolbox managers (order is important).
- */
-
- mem_init();
- InitGraf(&thePort);
- InitFonts();
- InitWindows();
- InitMenus();
- TEInit();
- InitDialogs((ProcPtr) 0);
- InitCursor();
- DILoad();
- SetEventMask(everyEvent - keyUpMask);
- GetWMgrPort(&screenport);
- SetPort(screenport);
-
- menu_init();
- wind_init();
- doc_init();
- voice_init();
-
- /*
- * Set the port to the program's window,
- * then handle events until a "Quit" event is detected.
- */
-
- SetPort(windoc);
- while (doevent())
- ;
- closeup();
- }
-
- /*
- * closeup() - prepare to exit the program.
- */
-
- closeup()
- {
- voice_stop();
- SetEventMask(everyEvent - keyUpMask); /* restore default event mask */
- DIUnload();
- InitCursor();
- }
-
- /*
- * mem_init() - initialize the memory.
- */
-
- mem_init()
- {
- long *stackbaseptr; /* points to current stack base */
-
- /*
- * Allocate everything but the Max Stack Size to the Heap.
- */
-
- stackbaseptr = (long *) 0x908; /* CurStackBase from Tlasm/sysequ.text */
- SetApplLimit((Ptr) (*stackbaseptr - maxStackSize));
-
- /*
- * Expand the application heap zone to its maximum size, without
- * purging any purgeable resources. This saves memory compactions
- * and heap expansions later.
- */
-
- MaxApplZone();
-
- /*
- * get plenty of master pointers now; if we let the Memory Manager
- * allocate them as needed, they'd form non-relocatable islands in
- * the heap.
- *
- * Inside Mac says each call to MoreMasters() currently allocates 64 masters.
- * That's not a whole lot.
- */
-
- MoreMasters();
- MoreMasters();
- }
-
- /*
- * wind_init() - create the document window.
- */
-
- wind_init()
- {
- static WindowRecord wrecord; /* storage for our window */
-
- windoc = GetNewWindow(WINDOWID, &wrecord, (long) -1);
- }
-